<!--  -->
<script setup>
import { ref, reactive, toRefs,defineProps, onBeforeMount, onMounted, watchEffect, computed } from 'vue' // eslint-disable-line
import { useStore } from 'vuex'
import { useRoute, useRouter } from 'vue-router'
/**
* 仓库
*/
const store = useStore() // eslint-disable-line
const toggleClick = () => {
  store.commit('app/triggerSidebarOpened')
}
const icon = computed(() =>
  store.getters.sidebarOpened ? 'hamburger-opened' : 'hamburger-closed'
)
/**
* 路由对象
*/
const route = useRoute() // eslint-disable-line
/**
* 路由实例
*/
const router = useRouter() // eslint-disable-line
// 1-开始创建组件-setup
/**
* Props
*/
const props = defineProps({}) // eslint-disable-line
/**
* 数据部分
*/
const data = reactive({}) // eslint-disable-line
// 2.组件挂载页面之前执行----onBeforeMount
onBeforeMount(() => {})
// 3.-组件挂载到页面之后执行-------onMounted
onMounted(() => {})
watchEffect(() => {})

</script>
<template>
 <div class="hamburger-container" @click="toggleClick">
    <svg-icon class="hamburger" :icon="icon"></svg-icon>
  </div>
</template>

<style scoped lang='scss'>
  .hamburger-container {
  padding: 0 16px;
  .hamburger {
    display: inline-block;
    vertical-align: middle;
    width: 20px;
    height: 20px;
  }
}
</style>
